#ifndef CPP_TOOLS_SK_STORAGE_MEMMAP_HPP
#define CPP_TOOLS_SK_STORAGE_MEMMAP_HPP

#include "sk_storage/const.hpp"
#include <map>

namespace sk_storage {

class MemMap {

public:
  MemMap();

  Status Set(uint64_t log_id, const std::string &key, const std::string &value);

  Status Get(const std::string &key, std::string &value);

  bool IsImmutable() const;

  std::map<std::string, std::string> &GetSnapshot();

  ~MemMap();

private:
  std::map<std::string, std::string> mp_;

  uint64_t last_log_id_;

  uint64_t set_operator_num_;

  bool is_immutable_;
};

} // namespace sk_storage

#endif